<template>
  <div class="upinfo__module">
    <div class="left__group">
      <mivaAvatar :userInfo="upInfo" />
      <div @click="$emit('follow')" class="follow__btn not-follow">
        <span class="el-icon-plus">&nbsp;关注 {{follow | toTransfromTenThousand}}</span>
      </div>
    </div>
    <div class="info__group">
      <div class="nickname__group">
        <mivaLink :isNewTag="true" :to="upSpacePath" class="nickname__item">{{nickname}}</mivaLink>
        <mivaLink :isNewTag="true" class="msg__btn iconfont icon-icon_dmail">发消息</mivaLink>
      </div>
      <div class="sign__item">{{sign}}</div>
    </div>
  </div>
</template>

<script>
export default {
    name: 'ArchiveDetailUpinfo',
    props: {
        upInfo: {
            type: Object,
            required: true,
        },
    },
    computed: {
        uid() {
            return this.upInfo.uid;
        },
        upSpacePath() {
            return `/space/${this.uid}`;
        },
        nickname() {
            return this.upInfo.nickname || '--';
        },
        sign() {
            return this.upInfo.sign || '没有填写简介...';
        },
        follow() {
            return this.upInfo.follow || '99999';
        },
    },
};
</script>

<style lang="less">
.upinfo__module {
  display: flex;
  color: #666;
  .left__group {
    display: flex;
    flex-direction: column;
    align-items: center;
  }
  .info__group {
    width: 100%;
    margin-left: 16px;
  }
  .nickname__group {
    height: 20px;
    line-height: 20px;
    .nickname__item {
      display: inline-block;
      max-width: 180px;
      font-size: 14px;
      font-weight: bold;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
      vertical-align: top;
    }
    .msg__btn {
      margin-left: 12px;
      font-size: 12px;
      display: inline-block;
      vertical-align: middle;

      user-select: none;
    }
    .msg__btn::before {
      font-size: 14px;
      margin-right: 3px;
    }
  }
  .sign__item {
    line-height: 18px;
    margin-top: 4px;
    font-size: 12px;
    text-align: justify;
  }
  .follow__btn {
    margin-top: 15px;
    padding: 10px;
    white-space: nowrap;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.25s;
    cursor: pointer;
    user-select: none;
  }
  .not-follow {
    color: #fff;
    background-color: @base_color;
    box-shadow: 5px -5px 0px @base_color_2;
    transition: all 0.3s;
    &:hover {
      background-color: @base_color_2;
      box-shadow: -5px 5px 0px @base_color;
    }
  }
}
</style>
